<?php

namespace app\common\model\user;
use app\common\model\BaseModel;

class UserFocus extends BaseModel
{

    public static function tablePK(): ?string
    {
        return 'focus_id';
    }

    public static function tableName(): string
    {
        return 'user_focus';
    }

    public function focus()
    {
        return $this->hasOne(User::class,'uid','to_uid')->field('nickname,uid,avatar');
    }

    public function fans()
    {
        return $this->hasOne(User::class,'uid','uid')->field('nickname,uid,avatar');
    }

}